package com.sugree.twitter.views;

import java.io.IOException;
import java.util.Vector;
import java.util.Enumeration;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;

import com.substanceofcode.utils.TimeUtil;
import com.substanceofcode.utils.Log;
import com.substanceofcode.twitter.model.Status;
import com.sugree.twitter.TwitterController;

public class AlertScreen extends Form implements CommandListener {
	private TwitterController controller;
	private Displayable nextDisplay;

	private StringItem textField;
	private Command backCommand;

	public AlertScreen(TwitterController controller, String title, String text, Displayable nextDisplay) {
		super(title);
		this.controller = controller;
		this.nextDisplay = nextDisplay;

		textField = new StringItem("", text+"\n\n"+Log.getText());
		append(textField);

		backCommand = new Command("Ok", Command.OK, 2);
		addCommand(backCommand);

		setCommandListener(this);
	}

	public void commandAction(Command cmd, Displayable display) {
		if (cmd == backCommand) {
			controller.setCurrent(nextDisplay);
		}
	}
}
